HTML - tags - var tag

revision:


Content

"var" tag : define variable in programming or expression syntax some examples


"var" tag : define variable in programming or expression

top

The <var> tag is used to define a variable in programming or in a mathematical expression. The content inside is typically displayed in italic.

This tag is not deprecated. However, it is possible to achieve richer effect by using CSS.

Attributes: the <var> element supports the global attributes and events attributes.


syntax

top

: <var> . . . </var>


some examples

top

The area of a triangle is: 1/2 x b x h, where b is the base, and h is the vertical height.

Codes:
                    <p class="spec">The area of a triangle is: 1/2 x <var>b</var> x <var>h</var>, where <
                    var>b</var> is the base, and <var>h</var> is the vertical height.</p>
                

The equation for any straight line can be expressed in the formula: y = mx + b.

Codes:

                    <p class="spec">The equation for any straight line can be expressed in the formula: <
                        var>y</var> = <var>mx</var> + <var>b</var>s.</p>